package IMIC.NGUYENVANTINH.OOP.LEVEL2.EX6;

import java.util.Scanner;

public class Views {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		MyInteger myInteger = new MyInteger();
		int n = 0;
		boolean flag = false;
		System.out.println("Input a number:");
		while (!flag) {
			try {
				myInteger.setNumber(sc.nextInt());
				flag = true;
			} catch (Exception e) {
				System.out.println("Phai nhap so...");
				sc.nextLine();

			}
		}

		Controllers ctrl = new Controllers();
		System.out.println("Number is Even " + ctrl.checkisEven(myInteger));
		System.out.println("Number is Odd " + ctrl.checkisOdd(myInteger));
		System.out.println("Number is Prime " + ctrl.checkisPrime(myInteger));

		System.out.println("Number is Even " + Controllers.checkisEven(myInteger.getNumber()));
		System.out.println("Number is Odd " + Controllers.checkisOdd(myInteger.getNumber()));
		System.out.println("Number is Prime " + Controllers.checkisPrime(myInteger.getNumber()));
		
		System.out.println("Equals object Myinteger vs enter number");
		System.out.println("MyInteger equals :" + 4 +" " + ctrl.equals(myInteger,4));

	}

	public int parseInt(String str) {

		int a = Integer.parseInt(str);
		return a;
	}

}
